package com.project.sianet.util.extenders;

import com.project.sianet.util.TypefaceManager;
import com.project.sianet.R;

import android.app.Application;
import android.content.Context;
import android.content.SharedPreferences;
import android.preference.PreferenceManager;
import android.text.TextUtils;

//import com.project.sianet.R;
//import com.project.sianet.data.Client.UsuarioClient;
//import com.project.sianet.data.ResteasyClient.UsuarioResteasyClient;

public class SianetApplication extends Application {

//	private UsuarioClient usuario;
//    public static String KEY_BOOK_ISBN = "KEY_BOOK_INDEX";
//    public static String LOG_TAG = "JaxrsSample";
//    public static String seedValue = "CTB_SIANET_SEGURIDAD";

//    @Override
//    public void onCreate() {
//        super.onCreate();
//        usuario = new UsuarioResteasyClient(this);
//    }
//
//    public UsuarioClient getUsuarioClient() {
//        return usuario;
//    }

	@Override
	public void onCreate() {
		super.onCreate();
		TypefaceManager.initialize(this, R.xml.fonts);
	}
	
    public static String getRequestURI(Context context) {
//    	SharedPreferences prefs = context.getSharedPreferences("SianetPref", 0);
    	SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
        String host;
		try {
			host = context.getString(R.string.pref_host_default) + prefs.getString("ColegioPF", "");
		} catch (Exception e) {
			host = "";
			e.printStackTrace();
		}
		
		if (TextUtils.isEmpty(host))
			return null;
		else
			return host + "/MobileService.svc";
		
    }
	
}
